package com.bci.internal.engine.bcibpmengine.listener;


import org.activiti.engine.delegate.DelegateTask;
import org.activiti.engine.delegate.TaskListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

/**
 * 任务监听器
 *
 * @author jzwu
 * @since 2021/3/21 0021
 */

public class TkListener6 implements TaskListener {
    private static final Logger LOGGER = LoggerFactory.getLogger(TkListener6.class);

    @Override
    public void notify(DelegateTask delegateTask) {
        LOGGER.info("执行人2：{}", delegateTask.getVariable("delegateAssignee"));
        Map<String, Object> mapVaribales = new HashMap<>();
        ArrayList<String> assigneeDirectorList = new ArrayList<>();
        assigneeDirectorList.add("wukong");
        assigneeDirectorList.add("tangshen");

//        execution.setVariable("assigneeDirectorList",assigneeDirectorList);
        mapVaribales.put("assigneeDirectorList", assigneeDirectorList);
//        mapVaribales.put("number", 2);
//        delegateTask.setVariable("number",2);
        delegateTask.setVariables(mapVaribales);
    }
}